<template>
  <div 
    class="hq-button" 
    :style="{background:color}"
    @click="$emit('click',$event)"
  >{{text}}</div>
</template>

<script>
  export default {
    name:'hq-button',
    props:{
      //属性:类型约定
      text:{
        type:String,
        default:'按 钮',
      },
      color:{
        type:String,
        default:'#4c4f50'
      },
      /* type:{
        type:String,
        default:'default',
        validator:function(value){
          return /primary|info|warning|danger/.test(value)
        }
      } */
    },
    /* methods:{
      show(e){
        this.$emit('xx',e)
      }
    } */
  }
</script>

<style scoped>
  .hq-button{
    background: #4c4f50;color:#fff;text-align: center;
    display: block;font-size: 0.28rem;line-height: 0.65rem;
    border-radius: 8px;
  }
</style>